﻿using System;
using System.Collections.Generic;
using System.Text;
using ContentRenderingApi.Extender;
using ContentRenderingApi.Path;

namespace ContentRenderingApi.Skeleton
{
    /// <summary/>
    internal class SelfSortSkeleton
    {
        private AbstractPath _path;
        private Type _type;
        private Func<object, object, int> _selfSortCallback;

        /// <summary/>
        internal SelfSortSkeleton(
            AbstractPath path,
            Type type,
            Func<object, object, int> selfSortCallback)
        {
            this._path = path;
            this._type = type;
            this._selfSortCallback = selfSortCallback;
        }

        /// <summary/>
        public AbstractPath Path
        {
            get { return this._path; }
        }

        /// <summary/>
        public Type Type
        {
            get { return this._type; }
        }

        /// <summary/>
        public int Compare(object valueOne, object valueTwo)
        {
            return this._selfSortCallback(valueOne, valueTwo);
        }
    }
}
